package string.nowcoder.easy;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author Stark
 * @description 删除公共字符
 * 把原字符串按照删除字符串中的字符进行删除后返回
 * 题目链接：https://www.nowcoder.com/practice/f0db4c36573d459cae44ac90b90c6212?tpId=85&&tqId=29
 * 868&rp=1&ru=/activity/oj&qru=/ta/2017test/question-ranking
 * @date 2022/4/17 20:35
 **/
public class DeletePublicString {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            String str = scanner.nextLine();
            String strD = scanner.nextLine();
            //使用set将需要删除的字符存入
            Set<Character> set = new HashSet<>();
            for (int i = 0; i < strD.length(); i++) {
                set.add(strD.charAt(i));
            }
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                //查重,没有再进行拼接
                if(!set.contains(ch)){
                    sb.append(ch);
                }
            }
            System.out.println(sb.toString());
        }
    }
}
